package study.transaction.seata.client;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

@Slf4j
@Component
public class AccountClient {

    private static final String URL = "http://127.0.0.1:7100/account/create?";

    @Autowired
    private RestTemplate restTemplate;

    public void checkIn(Long ubId, boolean throwEx) {
        String url = URL + "ubId=" + ubId + "&throwEx=" + throwEx;
        restTemplate.getForObject(url, Void.class);
    }
}

